Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multi-ASIC] BGP internal neighbor table support #5520

Merged
merged 5 commits into from
Oct 28, 2020

Conversation

judyjoseph
Copy link
Contributor

@judyjoseph judyjoseph commented Oct 1, 2020

- Why I did it

Introduce a new table for BGP internal neighbor sessions which will be used in case of multi-asic platforms for the IBGP sessions between the BGP instances running in namespaces mapped to ASIC. This is the follow up of the comments added for a fix earlier to create internal BGP peer group ( #4620 (comment) )

- How I did it
Updated the minigraph parsing logic to get the bgp_internal_sessions

- How to verify it
Checked the DB to find that the BGP_INTERNAL_NEIGHBOR table is populated with internal BGP neigibors.

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@judyjoseph judyjoseph force-pushed the bgp_internal_neighbor branch from 46dc4ca to 6fd60a6 Compare October 9, 2020 00:14
Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add tests for the new templates and update tests for the old?

@judyjoseph judyjoseph force-pushed the bgp_internal_neighbor branch from 6fd60a6 to 2b15a57 Compare October 13, 2020 06:25
@judyjoseph judyjoseph marked this pull request as ready for review October 15, 2020 17:43
@pavel-shirshov
Copy link
Contributor

Can you please add template tests data in src/sonic-bgpcfgd/tests/data ?

@judyjoseph
Copy link
Contributor Author

Can you please add template tests data in src/sonic-bgpcfgd/tests/data ?

@pavel-shirshov I updated/added tests here in my earlier commit 2b15a57. But let me check if I need to cover more scenarios

@judyjoseph
Copy link
Contributor Author

retest this please

pavel-shirshov
pavel-shirshov previously approved these changes Oct 16, 2020
Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd better remove not required entries.

@judyjoseph judyjoseph force-pushed the bgp_internal_neighbor branch from d0838bd to a89643d Compare October 22, 2020 23:29
@judyjoseph
Copy link
Contributor Author

retest this please

@judyjoseph
Copy link
Contributor Author

retest vsimage please

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@judyjoseph
Copy link
Contributor Author

@arlakshm , Could you take a look as well ?

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, couple of minor comments

!
neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }}
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }}
!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, should add the lines to add the timer configuration if they are not default.
These configuration
https://github.com/Azure/sonic-buildimage/blob/09d5a62fad22313b29afe1419d329abe45fbef6d/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2#L6-L10

Copy link
Contributor Author

@judyjoseph judyjoseph Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure will update. As discussed will raise a follow up PR for adding this change.

neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V4
!
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %}
neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V4 in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is route-map configuration line repeated? The same line present in the peer_group.conf.j2 configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at both .. they are not same.
Here we set it per neighbor_ip_address, while in the peer_group.conf.j2 it is set on the peer group -- similar to how it was done before as well.

@judyjoseph judyjoseph merged commit 6088bd5 into sonic-net:master Oct 28, 2020
judyjoseph added a commit that referenced this pull request Nov 9, 2020
- Why I did it
Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table.
Additionally to address the review comment #5520 (comment)
Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up.
Updates to the internal tests data + add all of it to template tests.

- How I did it
Updated the APIs and the template files.

- How to verify it
Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
judyjoseph added a commit to judyjoseph/sonic-buildimage that referenced this pull request Nov 10, 2020
…c-net#5760)

- Why I did it
Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table.
Additionally to address the review comment sonic-net#5520 (comment)
Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up.
Updates to the internal tests data + add all of it to template tests.

- How I did it
Updated the APIs and the template files.

- How to verify it
Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
abdosi pushed a commit that referenced this pull request Nov 10, 2020
* Initial commit for BGP internal neighbor table support.
  > Add new template named "internal" for the internal BGP sessions
  > Add a new table in database "BGP_INTERNAL_NEIGHBOR"
  > The internal BGP sessions will be stored in this new table "BGP_INTERNAL_NEIGHBOR"

* Changes in template generation tests with the introduction of internal neighbor template files.
abdosi pushed a commit that referenced this pull request Nov 10, 2020
- Why I did it
Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table.
Additionally to address the review comment #5520 (comment)
Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up.
Updates to the internal tests data + add all of it to template tests.

- How I did it
Updated the APIs and the template files.

- How to verify it
Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
@judyjoseph judyjoseph deleted the bgp_internal_neighbor branch November 11, 2020 07:15
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
* Initial commit for BGP internal neighbor table support.
  > Add new template named "internal" for the internal BGP sessions
  > Add a new table in database "BGP_INTERNAL_NEIGHBOR"
  > The internal BGP sessions will be stored in this new table "BGP_INTERNAL_NEIGHBOR"

* Changes in template generation tests with the introduction of internal neighbor template files.
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…c-net#5760)

- Why I did it
Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table.
Additionally to address the review comment sonic-net#5520 (comment)
Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up.
Updates to the internal tests data + add all of it to template tests.

- How I did it
Updated the APIs and the template files.

- How to verify it
Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
StormLiangMS pushed a commit to StormLiangMS/sonic-buildimage that referenced this pull request Jul 18, 2022
Reintroduce the msft templates for multi-asic(3164) after the following sonic public PR's ( for internal BGP neighbors) are available in internal-201911 branch.

sonic-net#5520
sonic-net#5760
sonic-net/sonic-swss-common#389
sonic-net/sonic-utilities#1224

How did I verify
-----------------
1. Verified the external and internal BGP sessions are up, shown correctly in "show ip bgp summary -d all" and show ip interface commands.

2. Ran related 3164 tests to make sure it is passing.

bgp/test_bgp_fact.py::test_bgp_facts[0-0] PASSED                                                                                                           [ 16%]
bgp/test_bgp_fact.py::test_bgp_facts[0-1] PASSED                                                                                                                [ 33%]
bgp/test_bgp_fact.py::test_bgp_facts[0-2] PASSED                                                                                                                [ 50%]
bgp/test_bgp_fact.py::test_bgp_facts[0-3] PASSED                                                                                                                [ 66%]
bgp/test_bgp_fact.py::test_bgp_facts[0-4] PASSED                                                                                                                [ 83%]
bgp/test_bgp_fact.py::test_bgp_facts[0-5] PASSED                                                                                                                [100%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[0] PASSED                                                                                             [ 57%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[1] PASSED                                                                                             [ 63%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[2] SKIPPED                                                                                            [ 68%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[3] SKIPPED                                                                                            [ 73%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[4] SKIPPED                                                                                            [ 78%]
bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[5] SKIPPED                                                                                            [ 84%]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants